home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / bbsdoors / odoors41.zip / OPENDOOR.H < prev    next >
C/C++ Source or Header  |  1993-02-26  |  18KB  |  453 lines

  1. /*          ╔════════════════════════════════════════════════════╗
  2.  *          ║   ┌─────┐                                          ║
  3.  *          ║   │     │┌────┐┌───┐┌──┐                           ║
  4.  *          ║   │     ││    │├───┘│  │                           ║
  5.  *          ║   └─────┘├────┘└─── │  ├────┐                      ║
  6.  *          ║          │             │    │┌───┐┌───┐┌─── ┌──    ║
  7.  *          ║                        │    ││   ││   ││    └──┐   ║
  8.  *          ║                        └────┘└───┘└───┘│     ──┘   ║
  9.  *          ║                    ────────────                    ║
  10.  *          ║      Door Programming Toolkit - Version 4.10       ║
  11.  *          ╚════════════════════════════════════════════════════╝
  12.  *       (C) Copyright 1991-1993 by Brian Pirie. All Rights Reserved.
  13.  *
  14.  *
  15.  *                     UNREGISTERED EVALUATION VERSION
  16.  *                                 ─────────
  17.  *  This version of OpenDoors may be used for a reasonable evaluation
  18.  *  period, and doors written with it may NOT be distributed. Your low $28
  19.  *  registration fee will entitle you to continue using OpenDoors,
  20.  *  distribute or even sell programs written with it, and you will be entitled
  21.  *  to free upgrades to newer versions of OpenDoors. Unlike other libraries
  22.  *  of this sort, OpenDoors requires no additional licencing fees - once you
  23.  *  have paid your $28, you will be entitled to unlimited use of the
  24.  *  package. For more information, see the accompanying OPENDOOR.DOC file.
  25.  */
  26.  
  27.  
  28. #ifndef OPENDOOR_H                              /* Only parse OPENDOOR.H once */
  29. #define OPENDOOR_H
  30.  
  31.  
  32.  
  33.                                               /* OPENDOORS GLOBAL DEFINITIONS */
  34.                                               /* ---------------------------- */
  35.  
  36. #ifdef __cplusplus                 /* Compiler-dependant function definitions */
  37. #define FUNCDEF extern "C"
  38. #else
  39. #define FUNCDEF
  40. #endif
  41.  
  42.  
  43.  
  44. extern char od_registered_to[36];            /* Program information variables */
  45. extern unsigned long od_registration_key;
  46. extern char od_program_name[40];
  47.  
  48.  
  49.  
  50. #define FALSE 0                               /* Boolean constant definitions */
  51. #define TRUE !FALSE
  52. #define MAYBE 2
  53.  
  54.  
  55.  
  56.                                 /* OPENDOORS DOORDRIVER FUNCTIONS DEFINITIONS */
  57.                                 /* ------------------------------------------ */
  58.  
  59. FUNCDEF int           od_carrier(void);   /* OpenDoors door driver functions */
  60. FUNCDEF void          od_clear_keybuffer(void);
  61. FUNCDEF void          od_clr_line(void);
  62. FUNCDEF void          od_clr_scr(void);
  63. FUNCDEF unsigned char od_colour_config(char *config_line);
  64. FUNCDEF void          od_disp(char *buffer, int size, char local_echo);
  65. FUNCDEF void          od_disp_str(char *string);
  66. FUNCDEF int           od_draw_box(char left, char top, char right, char bottom);
  67. FUNCDEF unsigned int  od_edit_str(char *input_string, char *format_string,
  68.                                   int row, int col, unsigned char normal_colour,
  69.                                   unsigned char highlight_colour,
  70.                                   char character, unsigned int flags);
  71. FUNCDEF void          od_emulate(register char in_char);
  72. FUNCDEF void          od_exit(int errorlevel, char term_call);
  73. FUNCDEF char          od_get_answer(char *string);
  74. FUNCDEF int           od_get_key(int wait);
  75. FUNCDEF char          od_hotkey_menu(char *filename, char *hotkeys, char wait);
  76. FUNCDEF void          od_init(void);
  77. FUNCDEF void          od_init_with_config(char *filename,
  78.                                           void (*custom_line_function)
  79.                                                (char *keyword,char *options));
  80. FUNCDEF void          od_input_str(char *string, int max_len,
  81.                                   unsigned char minchar, unsigned char maxchar);
  82. FUNCDEF void          od_kernal(void);
  83. FUNCDEF int           od_list_files(char *directory);
  84. FUNCDEF int           od_log_open();
  85. FUNCDEF int           od_log_write(char *message);
  86. FUNCDEF void          od_page(void);
  87. FUNCDEF void          od_printf(char *format, ...);
  88. FUNCDEF void          od_putch(int character);
  89. FUNCDEF void          od_repeat(char value, unsigned char times);
  90. FUNCDEF int           od_send_file(char *filename);
  91. FUNCDEF void          od_set_attrib(int colour);
  92. #define               od_set_colour(x, y) od_set_attrib(x|(y<<4))
  93. FUNCDEF void          od_set_cursor(int row, int col);
  94. FUNCDEF void          od_set_statusline(char setting);
  95. FUNCDEF int           od_spawn(char *command_line);
  96. FUNCDEF int           od_spawnvpe(int modeflag, char *path, char *argv[],
  97.                                   char *envp[]);
  98.  
  99.  
  100. #define P_WAIT    0                                    /* od_spawnvpe() flags */
  101. #define CURRENT   0
  102. #define IRET      1
  103.  
  104.  
  105. #define EDIT_FLAG_NORMAL          0x0000               /* od_edit_str() flags */
  106. #define EDIT_FLAG_NO_REDRAW       0x0001
  107. #define EDIT_FLAG_FIELD_MODE      0x0002
  108. #define EDIT_FLAG_EDIT_STRING     0x0004
  109. #define EDIT_FLAG_STRICT_INPUT    0x0008
  110. #define EDIT_FLAG_PASSWORD_MODE   0x0010
  111. #define EDIT_FLAG_ALLOW_CANCEL    0x0020
  112. #define EDIT_FLAG_FILL_STRING     0x0040
  113. #define EDIT_FLAG_AUTO_ENTER      0x0080
  114. #define EDIT_FLAG_AUTO_DELETE     0x0100
  115. #define EDIT_FLAG_KEEP_BLANK      0x0200
  116. #define EDIT_FLAG_PERMALITERAL    0x0400
  117. #define EDIT_FLAG_LEAVE_BLANK     0x0800
  118.  
  119.  
  120.  
  121. #define EDIT_RETURN_ERROR         0            /* od_edit_str() return values */
  122. #define EDIT_RETURN_CANCEL        1
  123. #define EDIT_RETURN_ACCEPT        2
  124. #define EDIT_RETURN_PREVIOUS      3
  125. #define EDIT_RETURN_NEXT          4
  126.  
  127.  
  128.  
  129. #define STATUS_NORMAL      1                /* OpenDoors status line settings */
  130. #define STATUS_NONE        10
  131. #define STATUS_HELP        9
  132. #define STATUS_USER1       2
  133. #define STATUS_USER2       3
  134. #define STATUS_USER3       5
  135. #define STATUS_USER4       6
  136. #define STATUS_SYSTEM      4
  137.  
  138.  
  139.  
  140. #define D_BLACK    0                          /* OpenDoors colour definitions */
  141. #define D_BLUE     1
  142. #define D_GREEN    2
  143. #define D_CYAN     3
  144. #define D_RED      4
  145. #define D_MAGENTA  5
  146. #define D_BROWN    6
  147. #define D_GREY     7
  148. #define L_BLACK    8
  149. #define L_BLUE     9
  150. #define L_GREEN    10
  151. #define L_CYAN     11
  152. #define L_RED      12
  153. #define L_MAGENTA  13
  154. #define L_YELLOW   14
  155. #define L_WHITE    15
  156. #define B_BLACK    L_BLACK
  157. #define B_BLUE     L_BLUE
  158. #define B_GREEN    L_GREEN
  159. #define B_CYAN     L_CYAN
  160. #define B_RED      L_RED
  161. #define B_MAGENTA  L_MAGENTA
  162. #define B_BROWN    L_YELLOW
  163. #define B_GREY     L_WHITE
  164.  
  165.  
  166.  
  167.                                     /* OPENDOORS DOORDRIVER CONTROL STRUCTURE */
  168.                                     /* -------------------------------------- */
  169.  
  170. struct _od_control                 /* OpenDoors door driver control structure */
  171.    {
  172.    char          info_path[60];          /* Location of door information file */
  173.  
  174.  
  175.    char          port;                                   /* Modem information */
  176.    unsigned int  baud;
  177.  
  178.  
  179.    char          system_name[40];                 /* Caller & BBS information */
  180.    char          sysop_name[40];
  181.    long          system_calls;
  182.    char          system_last_caller[36];
  183.    char          timelog_start_date[9];
  184.    int           timelog_busyperhour[24];
  185.    int           timelog_busyperday[7];
  186.  
  187.    char          user_name[36];
  188.    char          user_location[26];
  189.    char          user_password[16];
  190.    char          user_dataphone[13];
  191.    char          user_homephone[13];
  192.    char          user_lasttime[6];
  193.    char          user_lastdate[9];
  194.    char          user_attribute;
  195.    char          user_flags[4];
  196.    unsigned int  user_net_credit;
  197.    unsigned int  user_pending;
  198.    unsigned int  user_messages;
  199.    unsigned int  user_lastread;
  200.    unsigned int  user_security;
  201.    unsigned int  user_numcalls;
  202.    unsigned int  user_uploads;
  203.    unsigned int  user_downloads;
  204.    unsigned int  user_upk;
  205.    unsigned int  user_downk;
  206.    unsigned int  user_todayk;
  207.    unsigned int  user_time_used;
  208.    unsigned int  user_screen_length;
  209.    char          user_last_pwdchange;
  210.    char          user_attrib2;
  211.    unsigned char user_group;
  212.    unsigned int  user_xi_record;
  213.  
  214.    char          event_status;
  215.    char          event_starttime[6];
  216.    unsigned char event_errorlevel;
  217.    char          event_days;
  218.    char          event_force;
  219.    char          event_last_run[9];
  220.  
  221.    char          user_netmailentered;
  222.    char          user_echomailentered;
  223.    char          user_logintime[6];
  224.    char          user_logindate[9];
  225.    int           user_timelimit;
  226.    long          user_loginsec;
  227.    long          user_credit;
  228.    unsigned int  user_num;
  229.    int           user_readthru;
  230.    int           user_numpages;
  231.    int           user_downlimit;
  232.    char          user_timeofcreation[6];
  233.    char          user_logonpassword[16];
  234.    char          user_wantchat;
  235.    char          user_ansi;
  236.  
  237.    int           user_deducted_time;
  238.    char          user_menustack[50][9];
  239.    char          user_menustackpointer;
  240.    char          user_handle[36];
  241.    char          user_comment[81];
  242.    char          user_firstcall[9];
  243.    char          user_combinedrecord[25];
  244.    char          user_birthday[9];
  245.    char          user_subdate[9];
  246.    unsigned char user_screenwidth;
  247.    unsigned char user_msg_area;
  248.    unsigned char user_file_area;
  249.    unsigned char user_language;
  250.    unsigned char user_date_format;
  251.    char          user_forward_to[36];
  252.    char          user_error_free;
  253.    char          sysop_next;
  254.    char          user_emsi_session;
  255.    char          user_emsi_crtdef[41];
  256.    char          user_emsi_protocols[41];
  257.    char          user_emsi_capabilities[41];
  258.    char          user_emsi_requests[41];
  259.    char          user_emsi_software[41];
  260.    unsigned char user_hold_attr1;
  261.    unsigned char user_hold_attr2;
  262.    unsigned char user_hold_len;
  263.  
  264.    char          user_reasonforchat[78];
  265.    char          user_callsign[12];
  266.    char          user_sex;
  267.    char          user_avatar;
  268.  
  269.  
  270.    char          od_info_type;            /* Door information file statistics */
  271.    char          od_extended_info;
  272.    unsigned int  od_node;
  273.    char          od_ra_info;
  274.  
  275.  
  276.    char          od_okaytopage;                              /* Door settings */
  277.    int           od_pagestartmin;
  278.    int           od_pageendmin;
  279.    char          od_user_keyboard_on;
  280.    char          od_page_pausing;
  281.    char          od_last_input;
  282.    char          od_logfile_name[80];
  283.    char          od_logfile_disable;
  284.    unsigned int  od_maxtime;
  285.    int           od_maxtime_deduction;
  286.  
  287.  
  288.    char          od_box_chars[6];        /* OpenDoors customization variables */
  289.    char          od_colour_char;
  290.    char          od_colour_delimiter;
  291.    char          od_clear_on_exit;
  292.    unsigned char od_disable;
  293.    int           od_inactivity;
  294.    int           od_last_hot;
  295.    char          od_list_pause;
  296.    char          od_list_stop;
  297.    char          od_nocopyright;
  298.    char          od_noexit;
  299.    char          od_page_len;
  300.    char          od_status_on;
  301.    char          od_spawn_freeze_time;
  302.    char          od_swapping_disable;
  303.    char          od_swapping_noems;
  304.    char          od_swapping_path[80];
  305.  
  306.    void          (*od_before_exit)(void);            /* Custom function hooks */
  307.    void          (*od_cbefore_chat)(void);
  308.    void          (*od_cafter_chat)(void);
  309.    void          (*od_cbefore_shell)(void);
  310.    void          (*od_cafter_shell)(void);
  311.  
  312.  
  313.    unsigned int  key_chat;           /* OpenDoors function key customizations */   unsigned int        key_dosshell;
  314.    unsigned int  key_drop2bbs;
  315.    unsigned int  key_hangup;
  316.    unsigned int  key_keyboardoff;
  317.    unsigned int  key_lesstime;
  318.    unsigned int  key_lockout;
  319.    unsigned int  key_moretime;
  320.    unsigned int  key_status[8];
  321.    unsigned int  key_sysopnext;
  322.  
  323.    char          od_num_keys;                     /* Additional function keys */
  324.    int           od_hot_key[16];
  325.  
  326.  
  327.    char *         od_after_chat;           /* OpenDoors prompt customizations */
  328.    char *         od_after_shell;
  329.    char *         od_before_chat;
  330.    char *         od_before_shell;
  331.    char *         od_chat_reason;
  332.    char *         od_day[7];
  333.    char *         od_help_text;
  334.    char *         od_help_text2;
  335.    char *         od_inactivity_timeout;
  336.    char *         od_inactivity_warning;
  337.    char *         od_month[12];
  338.    char *         od_no_keyboard;
  339.    char *         od_no_sysop;
  340.    char *         od_no_response;
  341.    char *         od_no_time;
  342.    char *         od_offline;
  343.    char *         od_paging;
  344.    char *         od_press_key;
  345.    char *         od_status_line[15];
  346.    char *         od_sysop_next;
  347.    char *         od_time_left;
  348.    char *         od_time_warning;
  349.    char *         od_want_chat;
  350.  
  351.    char *         od_continue;
  352.    char           od_continue_yes;
  353.    char           od_continue_no;
  354.    char           od_continue_nonstop;
  355.  
  356.  
  357.    char          od_chat_colour1;          /* OpenDoors colour customizations */
  358.    char          od_chat_colour2;
  359.    char          od_list_comment_col;
  360.    char          od_list_name_col;
  361.    char          od_list_offline_col;
  362.    char          od_list_size_col;
  363.    char          od_list_title_col;
  364.    };
  365.  
  366. extern struct _od_control od_control;         /* od_control external variable */
  367.  
  368. #define DORINFO1         0                     /* Door information file types */
  369. #define EXITINFO         1
  370. #define RA1EXITINFO      2
  371. #define CHAINTXT         3
  372. #define SFDOORSDAT       4
  373. #define CALLINFO         5
  374. #define DOORSYS_GAP      6
  375. #define DOORSYS_DRWY     7
  376. #define QBBS275EXITINFO  8
  377. #define CUSTOM           9
  378. #define DOORSYS_WILDCAT  10
  379.  
  380. #define DIS_INFOFILE        0x01                    /* Function disable flags */
  381. #define DIS_CARRIERDETECT   0x02
  382. #define DIS_TIMEOUT         0x04
  383. #define DIS_LOCAL_OVERRIDE  0x08
  384.  
  385. #define ES_DELETED 0                                 /* Event status settings */
  386. #define ES_ENABLED 1
  387. #define ES_DISABLED 2
  388.  
  389. extern char *od_log_messages[12];                     /* External text arrays */
  390. extern char od_config_text[31][33];
  391. extern char od_config_lines[24][33];
  392. extern char od_config_colours[12][33];
  393.  
  394.  
  395.                                                  /* OLD VERSION COMPATIBILITY */
  396.                                                  /* ───────────────────────── */
  397.  
  398. #define key_help                       key_status[6]
  399. #define key_nohelp                     key_status[0]
  400. #define od_chat_color1                 od_chat_colour1
  401. #define od_chat_color2                 od_chat_colour2
  402. #define od_set_color(x, y)             od_set_attrib(x|(y<<4))
  403. #define user_credit                    user_net_credit
  404. #define caller_netmailentered          user_netmailentered
  405. #define caller_echomailentered         user_echomailentered
  406. #define caller_logintime               user_logintime
  407. #define caller_logindate               user_logindate
  408. #define caller_timelimit               user_timelimit
  409. #define caller_loginsec                user_loginsec
  410. #define caller_credit                  user_credit
  411. #define caller_userrecord              user_num
  412. #define caller_readthru                user_readthru
  413. #define caller_numpages                user_numpages
  414. #define caller_downlimit               user_downlimit
  415. #define caller_timeofcreation          user_timeofcreation
  416. #define caller_logonpassword           user_logonpassword
  417. #define caller_wantchat                user_wantchat
  418. #define caller_ansi                    user_ansi
  419. #define ra_deducted_time               user_deducted_time
  420. #define ra_menustack                   user_menustack
  421. #define ra_menustackpointer            user_menustackpointer
  422. #define ra_userhandle                  user_handle
  423. #define ra_comment                     user_comment
  424. #define ra_firstcall                   user_firstcall
  425. #define ra_combinedrecord              user_combinedrecord
  426. #define ra_birthday                    user_birthday
  427. #define ra_subdate                     user_subdate
  428. #define ra_screenwidth                 user_screenwidth
  429. #define ra_msg_area                    user_msg_area
  430. #define ra_file_area                   user_file_area
  431. #define ra_language                    user_language
  432. #define ra_date_format                 user_date_format
  433. #define ra_forward_to                  user_forward_to
  434. #define ra_error_free                  user_error_free
  435. #define ra_sysop_next                  sysop_next
  436. #define ra_emsi_session                user_emsi_session
  437. #define ra_emsi_crtdef                 user_emsi_crtdef
  438. #define ra_emsi_protocols              user_emsi_protocols
  439. #define ra_emsi_capabilities           user_emsi_capabilities
  440. #define ra_emsi_requests               user_emsi_requests
  441. #define ra_emsi_software               user_emsi_software
  442. #define ra_hold_attr1                  user_hold_attr1
  443. #define ra_hold_attr2                  user_hold_attr2
  444. #define ra_hold_len                    user_hold_len
  445. #define caller_usernum                 user_num
  446. #define caller_callsign                user_callsign
  447. #define caller_sex                     user_sex
  448. #define od_avatar                      user_avatar
  449. #define B_YELLOW                       L_YELLOW
  450. #define B_WHITE                        L_WHITE
  451. #define od_rbbs_node                   od_node
  452. #endif
  453.